package com.brave.notice.service;

import com.brave.base.BaseService;
import com.brave.notice.dto.FindMyNoticeListDTO;
import com.brave.notice.repository.MCNoticeInfoRepository;
import com.brave.user.dto.RedisUserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class NoticeQueryService extends BaseService
{
    @Autowired
    private MCNoticeInfoRepository noticeInfoRepository;


    /**
     * 2019年10月8日 14:51:51
     * 查询我的通知列表
     * @param redisUserInfo
     * @return
     */
    public String findMyNoticeList(RedisUserInfo redisUserInfo, FindMyNoticeListDTO dto)
    {
        StringBuilder querySQL = new StringBuilder();
        querySQL.append("SELECT * FROM mc_notice_info WHERE receive_user_id = ")
            .append(redisUserInfo.getId());
        Map<String, Object> resultMap = noticeInfoRepository.findPageList(querySQL.toString(), dto.getPageSize(), dto.getPageNumber());
        return success(resultMap);
    }
    
    
    
    
    
    
    
}